package com.eorchis.module.trainingclass.querybean;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.eorchis.utils.DateUtil;
import com.eorchis.utils.utils.PropertyUtil;

import oracle.sql.BLOB;

/**
 * Title: TrainingClass<br>
 * Description: 培训班信息实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author Max
 * @createDate 2013-12-10
 * @version $Revision$
 */

public class TrainingClassQueryBean {

	private String classId;//培训班ID
	private Integer reportState;//上报审核状态
	private Integer auditState;//班级项目审核状态
	private Integer classUserNum;
	private Integer openState;
	private Integer endState;
	private String className;//培训班名称
	private String classNum;//班级编号
	private String trainingDeptName;//培训单位
	private Date beginDate;//开班时间
	private Date endDate;//结班时间
	private Date beginDateNoYear;//开班时间（没有年份）
	private Date endDateNoYear;//结班时间（没有年份）
	private Double trainingHour;//培训课时
	private BigInteger reportedNum;//已报人数 (通过审核)
	private BigInteger reportedNumber;//所有已报人数
	private String reportedNumStr;
	private Integer publishState;
	private Integer activeState;
	private Integer signUpState;//报名状态
	private String classTypeCode;//班级类型编码
	private String classTypeStr;//班级类型
	private Date reasonDate;
	private String auditReason;
	private Date enterBeginTime;//报名开始时间
	private Date enterEndTime;//报名结束时间
	private Date enterBeginTimeNoYear;//报名开始时间（没有年份）
	private Date enterEndTimeNoYear;//报名结束时间（没有年份）
	private Integer countUserNum;//已报人数 
	private Integer depUserNum;//本单位已报人数
	private Date createDate;//创建时间
	private String studentId;//学员id
	private Integer perfectState;
	private Integer allotDeptState;
	private Integer ROWNUM_;
	private Long  allAttendance; //全勤
	private Long  absenceAttendance; //缺勤
	private Long  leaveAttendance; //请假人数
	private Long  noAttendance;  //未出勤
	private String attendanceRatePercent;

	private Double  attendanceRate =0.0; //出勤率

	//部委选学报名系统字段
	private String ministrieID;//承办部委id
	private String ministrieName;//承办部委名称
	private Long planCount;//计划人数
	private Long kbCount;//可报名额
	
	private String statisticalRate; //培训班调训完成率
	private Integer reportedCount;//已报人数 wtbwbb(委托部委办班审核学员界面专用，因为它会影响reportedNum的值)
	private Integer asignCount;//调整人数
	private Integer surplusCount;//剩余人数=调整人数-已报人数
	private String classLevel;//班级级别,固定值 1：市  2：县      wtbwbb(委托部委办班)
	private String selectedLetters;// 选调函
	
	private String  classDescription;//调训对象
	private String  jointMinistrieName;//合办部委
	
	private Integer answerUser;//已评估人数
	private Integer noAnswerUser;//未评估人数
	private String  nswerPerc;//参评率
	private String  questionnaireId;//问卷ID

	private Date assessStartTime;//评估开始时间
	private Date assessEndTime;//评估结束时间
	private String assessStartTimeStr;//评估开始时间
	private String assessEndTimeStr;//评估结束时间
	private String asignCountCount;//调整人数
	
	private String questionnaireName;//问卷名称
	
	private Integer actualDate;//实际时间
	
	private String deptName;//单位名称
	private Integer attendance;//实际考勤人员
	private String attendanceRateStr;//考勤率
	
	private String courseName;//课程名称
	private String courseNum;//课程编号
	private String courseId;//课程Id
	

	private String canBeAudited; // 是否可进行报名审核 y/n
	private String sponsorID;//主办单位ID
	private String sponsorName;//主办单位ID
	private Integer questionnaireMethod;//评估方式
	private Integer configQuestionnaireState;//配置问卷状态	1：已配置	2：未配置
	
	private Integer lockState;//考核管理锁定状态
	
	private String classnameYear;//年度
	private String categoryId;//培训类别
	private String beoffStation;//离岗状态
	
	private String startDateState;
	private String endDateState;
	private String lockStateStr;
	private Integer lockDateState;
	private String lockNum;
	private String createDepname;
	private String depIDs;
	private Double trainingClassSum;//班级总学时 
	private Double trainingClassAvg;//班级平均学时 
	private Integer noClassUserNum;//未参与班级的学员数量
	
	public String getQuestionnaireId() {
		return questionnaireId;
	}
	public void setQuestionnaireId(String questionnaireId) {
		this.questionnaireId = questionnaireId;
	}
	public Integer getAnswerUser() {
		return answerUser;
	}
	public void setAnswerUser(BigInteger answerUser) {
		this.answerUser = answerUser.intValue();
	}
	public Integer getNoAnswerUser() {
		return noAnswerUser;
	}
	public void setNoAnswerUser(BigInteger noAnswerUser) {
		this.noAnswerUser = noAnswerUser.intValue();
	}
	public String getNswerPerc() {
		return nswerPerc;
	}
	public void setNswerPerc(String nswerPerc) {
		this.nswerPerc = nswerPerc;
	}
	public String getClassDescription() {
		return classDescription;
	}
	public void setClassDescription(String classDescription) {
		this.classDescription = classDescription;
	}
	public String getJointMinistrieName() {
		return jointMinistrieName;
	}
	public void setJointMinistrieName(String jointMinistrieName) {
		this.jointMinistrieName = jointMinistrieName;
	}
	public String getMinistrieID() {
		return ministrieID;
	}
	public void setMinistrieID(String ministrieID) {
		this.ministrieID = ministrieID;
	}
	public String getMinistrieName() {
		return ministrieName;
	}
	public void setMinistrieName(String ministrieName) {
		this.ministrieName = ministrieName;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Integer getCountUserNum() {
		return countUserNum;
	}
	public void setCountUserNum(Integer countUserNum) {
		this.countUserNum = countUserNum;
	}
	public Integer getDepUserNum() {
		return depUserNum;
	}
	public void setDepUserNum(Integer depUserNum) {
		this.depUserNum = depUserNum;
	}
	public String getEnterBeginTime() {
		return DateUtil.getDateString(enterBeginTime, "yyyy-MM-dd");
	}
	public void setEnterBeginTime(Date enterBeginTime) {
		this.enterBeginTime = enterBeginTime;
	}
	public String getEnterEndTime() {
		return DateUtil.getDateString(enterEndTime, "yyyy-MM-dd");
	}
	public void setEnterEndTime(Date enterEndTime) {
		this.enterEndTime = enterEndTime;
	}
	public Integer getEndState() {
		return endState;
	}
	public void setEndState(Integer endState) {
		this.endState = endState;
	}
	public String getClassId() {
		return classId;
	}
	public void setClassId(String classId) {
		this.classId = classId;
	}
	public Integer getReportState() {
		return reportState;
	}
	public void setReportState(Integer reportState) {
		this.reportState = reportState;
	}
	public Integer getAuditState() {
		return auditState;
	}
	public void setAuditState(Integer auditState) {
		this.auditState = auditState;
	}
	public Integer getClassUserNum() {
		return classUserNum;
	}
	public void setClassUserNum(Integer classUserNum) {
		if(classUserNum==null) {
			this.classUserNum=0;
		}else {
			this.classUserNum = classUserNum;
		}
	}
	public Integer getOpenState() {
		return openState;
	}
	public void setOpenState(Integer openState) {
		this.openState = openState;
	}
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	public String getClassNum() {
		return classNum;
	}
	public void setClassNum(String classNum) {
		this.classNum = classNum;
	}
	public String getBeginDate() {
		return DateUtil.getDateString(beginDate, "yyyy-MM-dd");
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	public String getEndDate() {
		return DateUtil.getDateString(endDate, "yyyy-MM-dd");
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public String getBeginDateNoYear() {
		return DateUtil.getDateString(beginDateNoYear, "MM-dd");
	}
	public void setBeginDateNoYear(Date beginDateNoYear) {
		this.beginDateNoYear = beginDateNoYear;
	}
	public String getEndDateNoYear() {
		return DateUtil.getDateString(endDateNoYear, "MM-dd");
	}
	public void setEndDateNoYear(Date endDateNoYear) {
		this.endDateNoYear = endDateNoYear;
	}
	public String getEnterBeginTimeNoYear() {
		return DateUtil.getDateString(enterBeginTime, "MM-dd");
	}
	public void setEnterBeginTimeNoYear(Date enterBeginTimeNoYear) {
		this.enterBeginTimeNoYear = enterBeginTimeNoYear;
	}
	public String getEnterEndTimeNoYear() {
		return DateUtil.getDateString(enterEndTime, "MM-dd");
	}
	public void setEnterEndTimeNoYear(Date enterEndTimeNoYear) {
		this.enterEndTimeNoYear = enterEndTimeNoYear;
	}
	public Double getTrainingHour() {
		return trainingHour;
	}
	public void setTrainingHour(Double trainingHour) {
		if(trainingHour==null) {
			this.trainingHour=0.0;
		}else {
			this.trainingHour = trainingHour;
		}
	}
	public BigInteger getReportedNum() {
		return reportedNum;
	}
	public void setReportedNum(BigInteger reportedNum) {
		this.reportedNum = reportedNum;
	}
	public Integer getPublishState() {
		return publishState;
	}
	public void setPublishState(Integer publishState) {
		this.publishState = publishState;
	}
	public Integer getActiveState() {
		return activeState;
	}
	public void setActiveState(Integer activeState) {
		this.activeState = activeState;
	}
	public Integer getSignUpState() {
		return signUpState;
	}
	public void setSignUpState(Integer signUpState) {
		this.signUpState = signUpState;
	}

	public String getTrainingDeptName() {
		return trainingDeptName;
	}
	public void setTrainingDeptName(String trainingDeptName) {
		this.trainingDeptName = trainingDeptName;
	}
	public String getClassTypeCode() {
		return classTypeCode;
	}
	public void setClassTypeCode(String classTypeCode) {
		this.classTypeCode = classTypeCode;
	}
	public String getClassTypeStr() {
		return classTypeStr;
	}
	public void setClassTypeStr(String classTypeStr) {
		this.classTypeStr = classTypeStr;
	}
	public Date getReasonDate() {
		return reasonDate;
	}
	public void setReasonDate(Date reasonDate) {
		this.reasonDate = reasonDate;
	}
	public String getAuditReason() {
		return auditReason;
	}
	public void setAuditReason(String auditReason) {
		this.auditReason = auditReason;
	}
	public Integer getPerfectState() {
		return perfectState;
	}
	public void setPerfectState(Integer perfectState) {
		this.perfectState = perfectState;
	}
	public String getStudentId() {
		return studentId;
	}
	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}
	public Integer getAllotDeptState() {
		return allotDeptState;
	}
	public void setAllotDeptState(Integer allotDeptState) {
		this.allotDeptState = allotDeptState;
	}
	public void setROWNUM_(Integer rOWNUM_) {
		ROWNUM_ = rOWNUM_;
	}
	public Long getAllAttendance() {
		return allAttendance;
	}
	public void setAllAttendance(Long allAttendance) {
		this.allAttendance = allAttendance;
	}
	public Long getAbsenceAttendance() {
		return absenceAttendance;
	}
	public void setAbsenceAttendance(Long absenceAttendance) {
		this.absenceAttendance = absenceAttendance;
	}
	public Long getLeaveAttendance() {
		return leaveAttendance;
	}
	public void setLeaveAttendance(Long leaveAttendance) {
		this.leaveAttendance = leaveAttendance;
	}
	/*public Long getAttendanceRate() {
		if(PropertyUtil.objectNotEmpty(allAttendance)&&PropertyUtil.objectNotEmpty(reportedNum)){
			if(reportedNum!=0){
				attendanceRate = allAttendance/reportedNum;
			}else{
				attendanceRate = 0L;
			}
		}
		return attendanceRate;
	}
	public void setAttendanceRate(Long attendanceRate) {
		this.attendanceRate = attendanceRate;
	}*/
	public void setAttendanceRate(Double attendanceRate) {
		this.attendanceRate = attendanceRate;
	}
	public Double getAttendanceRate() {
		if(PropertyUtil.objectNotEmpty(allAttendance)&&PropertyUtil.objectNotEmpty(reportedNum)){
			if(reportedNum.intValue()!=0){
				attendanceRate =  ((double)allAttendance/reportedNum.doubleValue());
			}else{
				attendanceRate = 0.0;
			}
		}
		if(PropertyUtil.objectNotEmpty(allAttendance)&&PropertyUtil.objectNotEmpty(countUserNum)){
			if(countUserNum!=0){
				attendanceRate =  ((double)allAttendance/(double)countUserNum);
			}else{
				attendanceRate = 0.0;
			}
		}
		return attendanceRate;
	}
	public String getAttendanceRatePercent() {
		if(PropertyUtil.objectNotEmpty(getAttendanceRate()))
			setAttendanceRatePercent(double2precent(getAttendanceRate()));
		return attendanceRatePercent;
	}
	public void setAttendanceRatePercent(String attendanceRatePercent) {
		this.attendanceRatePercent = attendanceRatePercent;
	}

	//计算百分比的方法
	private String double2precent(double d) {
		int maxValue = 1;
		DecimalFormat ddf1 = new DecimalFormat("#0.00");
		return d>=maxValue?"100.00%":new BigDecimal(ddf1.format(d / maxValue * 100)).setScale(2, BigDecimal.ROUND_HALF_UP) + "%";
	}


	public static void main(String[] args) {
		System.out.println(1/3);
	}
	public Long getNoAttendance() {
		return noAttendance;
	}
	public void setNoAttendance(Long noAttendance) {
		this.noAttendance = noAttendance;
	}
	public Long getPlanCount() {
		return planCount;
	}
	public void setPlanCount(Long planCount) {
		this.planCount = planCount;
	}
	public Long getKbCount() {
		return kbCount;
	}
	public void setKbCount(Long kbCount) {
		this.kbCount = kbCount;
	}
	public String getStatisticalRate() {
		DecimalFormat ddf1 = new DecimalFormat("#0.00");
		if(PropertyUtil.objectNotEmpty(getReportedNum())&&PropertyUtil.objectNotEmpty(getPlanCount())) {
			statisticalRate=ddf1.format((getReportedNum().doubleValue()/getPlanCount().doubleValue())*100)+"%";
		}else {
			statisticalRate=ddf1.format(0D)+"%";
		}
		return statisticalRate;
	}
	public void setStatisticalRate(String statisticalRate) {
		this.statisticalRate = statisticalRate;
	}
	public Integer getAsignCount() {
		if(PropertyUtil.objectNotEmpty(asignCount)){
			return asignCount;
		}else{
			return 0;
		}
	}
	public void setAsignCount(Integer asignCount) {
		this.asignCount = asignCount;
	}
	public Integer getSurplusCount() {
		if(PropertyUtil.objectNotEmpty(asignCount)){
			if(PropertyUtil.objectNotEmpty(reportedNum)){
				surplusCount=asignCount-reportedNum.intValue();
			}else{
				surplusCount=asignCount;
			}
		}else {
			surplusCount=0;
		}
		return surplusCount;
	}
	public void setSurplusCount(Integer surplusCount) {
		this.surplusCount = surplusCount;
	}
	public String getClassLevel() {
		return classLevel;
	}
	public void setClassLevel(String classLevel) {
		this.classLevel = classLevel;
	}
	public String getSelectedLetters() {
		return selectedLetters;
	}
	public void setSelectedLetters(String selectedLetters) {
		this.selectedLetters = selectedLetters;
	}
	public Integer getReportedCount() {
		return reportedCount;
	}
	public void setReportedCount(Integer reportedCount) {
		if(PropertyUtil.objectNotEmpty(reportedCount)){
			this.setReportedNum(new BigInteger(reportedCount.toString()));
		}
		this.reportedCount = reportedCount;
	}
	public String getAssessStartTime() {
		return DateUtil.getDateString(assessStartTime, "yyyy-MM-dd");
	}
	public void setAssessStartTime(Date assessStartTime) {
		if(PropertyUtil.objectNotEmpty(assessStartTime)){
			this.setAssessStartTimeStr(new SimpleDateFormat("yyyy-MM-dd").format(assessStartTime));
		}
		this.assessStartTime = assessStartTime;
	}
	public String getAssessEndTime() {
		return DateUtil.getDateString(assessEndTime, "yyyy-MM-dd");
	}
	public void setAssessEndTime(Date assessEndTime) {
		if(PropertyUtil.objectNotEmpty(assessEndTime)){
			this.setAssessEndTimeStr(new SimpleDateFormat("yyyy-MM-dd").format(assessEndTime));
		}
		this.assessEndTime = assessEndTime;
	}
	public String getAsignCountCount() {
		return asignCountCount;
	}
	public void setAsignCountCount(String asignCountCount) {
		this.asignCountCount = asignCountCount;
	}
	public String getQuestionnaireName() {
		return questionnaireName;
	}
	public void setQuestionnaireName(String questionnaireName) {
		this.questionnaireName = questionnaireName;
	}
	public Integer getActualDate() {
		return actualDate;
	}
	public void setActualDate(Object actualDate) {
		if(PropertyUtil.objectNotEmpty(actualDate)){
			this.actualDate = Integer.valueOf(actualDate.toString());
		}
	}
	public String getDeptName() {
		return deptName;
	}
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	public Integer getAttendance() {
		return attendance;
	}
	public void setAttendance(Integer attendance) {
		if(!PropertyUtil.objectNotEmpty(attendance)){
			attendance=0;
		}
		this.attendanceRateStr=attendance+"/"+this.planCount;
		this.attendance = attendance;
	}
	public String getAttendanceRateStr() {
		return attendanceRateStr;
	}
	public void setAttendanceRateStr(String attendanceRateStr) {
		this.attendanceRateStr = attendanceRateStr;
	}
	public String getAssessStartTimeStr() {
		return assessStartTimeStr;
	}
	public void setAssessStartTimeStr(String assessStartTimeStr) {
		this.assessStartTimeStr = assessStartTimeStr;
	}
	public String getAssessEndTimeStr() {
		return assessEndTimeStr;
	}
	public void setAssessEndTimeStr(String assessEndTimeStr) {
		this.assessEndTimeStr = assessEndTimeStr;
	}
	public String getCourseNum() {
		return courseNum;
	}
	public void setCourseNum(String courseNum) {
		this.courseNum = courseNum;
	}
	public String getCourseName() {
		return courseName;
	}
	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}
	public String getCourseId() {
		return courseId;
	}
	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}
	public String getCanBeAudited() {
		return canBeAudited;
	}
	public void setCanBeAudited(String canBeAudited) {
		this.canBeAudited = canBeAudited;
	}
	public String getSponsorID() {
		return sponsorID;
	}
	public void setSponsorID(String sponsorID) {
		this.sponsorID = sponsorID;
	}
	public String getSponsorName() {
		return sponsorName;
	}
	public void setSponsorName(String sponsorName) {
		this.sponsorName = sponsorName;
	}
	public BigInteger getReportedNumber() {
		return reportedNumber;
	}
	public void setReportedNumber(BigInteger reportedNumber) {
		this.reportedNumber = reportedNumber;
	}
	public String getReportedNumStr() {
		return reportedNumStr;
	}
	public void setReportedNumStr(String reportedNumStr) {
		this.reportedNumStr = reportedNumStr;
	}
	public Integer getQuestionnaireMethod() {
		return questionnaireMethod;
	}
	public void setQuestionnaireMethod(BigInteger questionnaireMethod) {
		this.questionnaireMethod = questionnaireMethod.intValue();
	}
	public Integer getConfigQuestionnaireState() {
		return configQuestionnaireState;
	}
	public void setConfigQuestionnaireState(Integer configQuestionnaireState) {
		this.configQuestionnaireState = configQuestionnaireState;
	}
	public Integer getLockState() {
		return lockState;
	}
	public void setLockState(Object lockState) {
		this.lockState = Integer.valueOf(lockState.toString());
	}
	public String getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}
	public String getBeoffStation() {
		return beoffStation;
	}
	public void setBeoffStation(String beoffStation) {
		this.beoffStation = beoffStation;
	}
	public String getClassnameYear() {
		return classnameYear;
	}
	public void setClassnameYear(String classnameYear) {
		this.classnameYear = classnameYear;
	}
	public String getStartDateState() {
		return startDateState;
	}
	public void setStartDateState(String startDateState) {
		this.startDateState = startDateState;
	}
	public String getEndDateState() {
		return endDateState;
	}
	public void setEndDateState(String endDateState) {
		this.endDateState = endDateState;
	}
	public String getLockStateStr() {
		return lockStateStr;
	}
	public void setLockStateStr(String lockStateStr) {
		this.lockStateStr = lockStateStr;
	}
	public Integer getLockDateState() {
		return lockDateState;
	}
	public void setLockDateState(Integer lockDateState) {
		this.lockDateState = lockDateState;
	}
	public String getLockNum() {
		return lockNum;
	}
	public void setLockNum(String lockNum) {
		this.lockNum = lockNum;
	}
	public String getCreateDepname() {
		return createDepname;
	}
	public void setCreateDepname(String createDepname) {
		this.createDepname = createDepname;
	}
	public String getDepIDs() {
		return depIDs;
	}
	public void setDepIDs(String depIDs) {
		this.depIDs = depIDs;
	}
	public Double getTrainingClassSum() {
		return trainingClassSum;
	}
	public void setTrainingClassSum(Object trainingClassSum) {
		this.trainingClassSum = Double.valueOf(trainingClassSum.toString());
	}
	public Double getTrainingClassAvg() {
		return trainingClassAvg;
	}
	public void setTrainingClassAvg(Object trainingClassAvg) {
		this.trainingClassAvg = Double.valueOf(trainingClassAvg.toString());
	}
	public Integer getNoClassUserNum() {
		return noClassUserNum;
	}
	public void setNoClassUserNum(Object noClassUserNum) {
		this.noClassUserNum = Integer.valueOf(noClassUserNum.toString());
	}

}
